import jsonpath


class GetKeyword:
    # 查找关键字方法
    @staticmethod
    def getkeyword(source_data, keyword):
        try:
            return jsonpath.jsonpath(source_data, f'$..{keyword}')[0]
        except:
            print(f"查找关键字{keyword}不存在")
            return False
